home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
TPWENG
/
FILELOCK.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-07-22
|
426b
|
24 lines
program FileLock;
uses PXEngine, WinCrt;
const FileName = 'Table.DB';
var PxErr: Integer;
procedure PX(Code : integer);
begin
writeln(PXErrMsg(Code));
end;
begin
PX(PXWinInit('MyApp', pxShared));
(* Lock a file with write-lock *)
PxErr := PXNetFileLock(FileName, WL);
if PxErr <> PxSuccess then
Writeln(PxErrMsg(PxErr))
else PX(PXNetFileUnlock(FileName, WL));
PX(PXExit);
end.